home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / appl / scihelpe.sit / ternary diagram < prev   
Encoding:
Text File  |  1986-01-04  |  1.5 KB  |  76 lines  |  [TEXT/TEXT]

  1. label sample
  2. prompt 'hi there'
  3. return
  4.  
  5.  
  6. ''    'a set of procedures to plot ternary diagrams'
  7. ''    'the table must be at least 5 columns wide'
  8. ''    'with the fractions of end members A, B, C, in columns 1, 2, 3'
  9. ''    'columns 4 and 5 are used, so dont put data in them'
  10. ''    'plot-triange draws the triangle on the graphics screen'
  11. ''    'plot-ternary recomputes C and plots the data'
  12. ''    'pick activated the cursor and prints out A,B,C values'
  13.  
  14.  
  15. label plot-triangle
  16.     ''    'requires 4 extra rows in the table and space for 3 variables'
  17.     setvar saverows @rows
  18.     setvar savecols @cols
  19.     setvar saveint @interpolated
  20.     insert row 1 4
  21.     rows 4
  22.     cols 5
  23.     table 1 1 1
  24.     table 1 2  0
  25.     table 2 1 0
  26.     table 2 2 1
  27.     table 3 1 0
  28.     table 3 2 0
  29.     table 4 1 1
  30.     table 4 2 0
  31.     execute  plot-ternary
  32.     clear
  33.     plot  4 5
  34.     vm @saverows + 4 = saverows
  35.     rows @saverows
  36.     delete row 1 4
  37.     cols @savecols
  38.     interpolated @saveint
  39.     delete variable saverows
  40.     delete variable savecols
  41.     delete variable saveint
  42.     return
  43.  
  44. label  plot-ternary
  45.     '' 'optional first argument is plotting symbol (default is stars)'
  46.     if @arg1 s= ''
  47.         setvar arg1 stars
  48.     xaxis 0 1
  49.     yaxis 0 1
  50.     constant 1 3
  51.     cmath 3 - 2 = 3
  52.     cmath 3 - 1 = 3
  53.     cmath 1 /# 2 = 4
  54.     cmath 3 + 4 = 4
  55.     cmath 1 *# 0.866 = 5
  56.     plot 4 5 @arg1
  57.     return
  58.  
  59. label pick
  60.     prompt 'use the abort menu to terminate this routine'
  61.     for i 1 100
  62.     cursor 'pick a point'
  63.     vmath @ypos / 0.866 = a
  64.     vmath @a / 2 = ao2
  65.     vmath  @xpos - @ao2 = c
  66.     vmath  @a + @c = b
  67.     vmath  1 - @b = b
  68.     prompt ' a = ' @a
  69.     prompt ' b = ' @b
  70.     prompt ' c = ' @c
  71.     next i
  72.     return
  73.  
  74.  
  75.  
  76.